home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 August / MW 8 2003 CD1.iso / Inside Macworld / Product News / gimp-1.2.4.sit / gimp-1.2.4 / app / message_cmds.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-11-04  |  3.7 KB  |  156 lines

  1. /* The GIMP -- an image manipulation program
  2.  * Copyright (C) 1995-2000 Spencer Kimball and Peter Mattis
  3.  *
  4.  * This program is free software; you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License as published by
  6.  * the Free Software Foundation; either version 2 of the License, or
  7.  * (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, write to the Free Software
  16.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17.  */
  18.  
  19. /* NOTE: This file is autogenerated by pdbgen.pl. */
  20.  
  21. #include "config.h"
  22.  
  23. #include "procedural_db.h"
  24.  
  25. #include "appenv.h"
  26.  
  27. static ProcRecord message_proc;
  28. static ProcRecord message_get_handler_proc;
  29. static ProcRecord message_set_handler_proc;
  30.  
  31. void
  32. register_message_procs (void)
  33. {
  34.   procedural_db_register (&message_proc);
  35.   procedural_db_register (&message_get_handler_proc);
  36.   procedural_db_register (&message_set_handler_proc);
  37. }
  38.  
  39. static Argument *
  40. message_invoker (Argument *args)
  41. {
  42.   gboolean success = TRUE;
  43.   gchar *message;
  44.  
  45.   message = (gchar *) args[0].value.pdb_pointer;
  46.   if (message == NULL)
  47.     success = FALSE;
  48.  
  49.   if (success)
  50.     g_message (message, NULL, NULL);
  51.  
  52.   return procedural_db_return_args (&message_proc, success);
  53. }
  54.  
  55. static ProcArg message_inargs[] =
  56. {
  57.   {
  58.     PDB_STRING,
  59.     "message",
  60.     "Message to display in the dialog"
  61.   }
  62. };
  63.  
  64. static ProcRecord message_proc =
  65. {
  66.   "gimp_message",
  67.   "Displays a dialog box with a message.",
  68.   "Displays a dialog box with a message. Useful for status or error reporting.",
  69.   "Manish Singh",
  70.   "Manish Singh",
  71.   "1998",
  72.   PDB_INTERNAL,
  73.   1,
  74.   message_inargs,
  75.   0,
  76.   NULL,
  77.   { { message_invoker } }
  78. };
  79.  
  80. static Argument *
  81. message_get_handler_invoker (Argument *args)
  82. {
  83.   Argument *return_args;
  84.  
  85.   return_args = procedural_db_return_args (&message_get_handler_proc, TRUE);
  86.   return_args[1].value.pdb_int = message_handler;
  87.  
  88.   return return_args;
  89. }
  90.  
  91. static ProcArg message_get_handler_outargs[] =
  92. {
  93.   {
  94.     PDB_INT32,
  95.     "handler",
  96.     "The current handler type: { MESSAGE_BOX (0), CONSOLE (1), ERROR_CONSOLE (2) }"
  97.   }
  98. };
  99.  
  100. static ProcRecord message_get_handler_proc =
  101. {
  102.   "gimp_message_get_handler",
  103.   "Returns the current state of where warning messages are displayed.",
  104.   "This procedure returns the way g_message warnings are displayed. They can be shown in a dialog box or printed on the console where gimp was started.",
  105.   "Manish Singh",
  106.   "Manish Singh",
  107.   "1998",
  108.   PDB_INTERNAL,
  109.   0,
  110.   NULL,
  111.   1,
  112.   message_get_handler_outargs,
  113.   { { message_get_handler_invoker } }
  114. };
  115.  
  116. static Argument *
  117. message_set_handler_invoker (Argument *args)
  118. {
  119.   gboolean success = TRUE;
  120.   gint32 handler;
  121.  
  122.   handler = args[0].value.pdb_int;
  123.   if (handler < MESSAGE_BOX || handler > ERROR_CONSOLE)
  124.     success = FALSE;
  125.  
  126.   if (success)
  127.     message_handler = handler;
  128.  
  129.   return procedural_db_return_args (&message_set_handler_proc, success);
  130. }
  131.  
  132. static ProcArg message_set_handler_inargs[] =
  133. {
  134.   {
  135.     PDB_INT32,
  136.     "handler",
  137.     "The new handler type: { MESSAGE_BOX (0), CONSOLE (1), ERROR_CONSOLE (2) }"
  138.   }
  139. };
  140.  
  141. static ProcRecord message_set_handler_proc =
  142. {
  143.   "gimp_message_set_handler",
  144.   "Controls where warning messages are displayed.",
  145.   "This procedure controls how g_message warnings are displayed. They can be shown in a dialog box or printed on the console where gimp was started.",
  146.   "Manish Singh",
  147.   "Manish Singh",
  148.   "1998",
  149.   PDB_INTERNAL,
  150.   1,
  151.   message_set_handler_inargs,
  152.   0,
  153.   NULL,
  154.   { { message_set_handler_invoker } }
  155. };
  156.